<?php 
    $link = "tin-tuc";
    $limit = 10;
    $tins = $modelHome->getListArticleByCategoryNew(2,-1,-1);
    $total_record = mysql_num_rows($tins);
    $total_record = ($total_record > 60) ? 60 : $total_record;
    $total_page = ceil($total_record/$limit);
    $offset = $limit * ($page - 1);
    $rs = $modelHome->getListArticleByCategoryNew(2,$offset,$limit);
    $page_show=5;  
?>
<div class="nav"> <a href="http://layhang.org" target="_self" class="arr">Trang chủ</a><a href="tin-tuc.html" target="_self">Tin tức</a> </div>
<div class="article-listing">
  <div class="list"> <span id="ctl00_cphMain_ArticleListing1_lblResult" class="lblresult"></span>
    <?php 
	$i=0;
	while($row = mysql_fetch_assoc($rs)){
		$i++;
	?>
    <div class="item <?php echo ($i%2==0) ? "right" : "";?>">
      <div class="image"> <a target="_self" style="display: table-cell;text-align: center; vertical-align: middle;   width:122px;   height:92px;" href="tin-tuc/<?php echo $row['title_alias']?>-<?php echo $row['article_id']; ?>.html" class="image"><img alt="" src="<?php echo str_replace("../","",$row['url_images']); ?>" width="122" height="92" class="image"></a> </div>
      <a href="tin-tuc/<?php echo $row['title_alias']?>-<?php echo $row['article_id']; ?>.html" class="title" target="_self">
	  <?php echo $row['title']; ?></a> <br>
      <span class="summary"> <?php echo $row['description']; ?> </span> <a href="tin-tuc/<?php echo $row['title_alias']?>-<?php echo $row['article_id']; ?>.html" class="detail">Chi tiết</a>
      <div class="clear"> </div>
    </div>    
    <?php } ?>
  </div>
  <div class="pager pager">
  <?php echo $modelHome->phantrang2($page,$page_show,$total_page,$link);?>
  </div>
  <div class="clear"> </div>
</div>